// pages/aaddplace/aaddplace.js
Page({

  data: {
    pointaddr:true
  },

  onLoad: function (options) {
    wx.request({
      url: 'https://www.juquduo.com/juquduo/locations/show_locations',
      data:{},
      success(res){
        console.log(res)
      }
    })

  },
  pointseted(){
    this.setData({pointaddr:false})
  },
  addplace(){
    var openid = wx.getStorageSync('openid')
    wx.request({
      url: 'https://www.juquduo.com/juquduo/locations/add_location',
      data:{
        openid:openid,
        placeName:'朝阳公园',
        //   latitude: 39.954728,
        //   longitude: 116.485776,
        lat:'39.954728',
        lng:'116.485776'
      },
      success(res){
        console.log(res)
        if(res.data.code==200){
          wx.navigateTo({
            url: './aaddpoint',
          })
        }
      }
    })
  },
})